import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
// import index from '@/views/index/index.vue'
// import aa from '@/views/index/aa.vue'
// import member from '@/views/index/member.vue'
// import star from '@/views/index/star.vue'

// import course from '@/views/course/course.vue'
// import Search from '@/views/course/Search.vue'
// import coursedata from '@/views/course/compon/coursedata.vue'

// import record from '@/views/record/record.vue'
// import practise from '@/views/practise/practise.vue'
// import login from '@/views/login/login.vue'
// import smslogin from '@/views/login/sms-login.vue'
import my from '@/views/my/my.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
      path: '/index',
      name: 'index',
      component: () =>
          import('@/views/index/index.vue'),
      meta: {
          footer: true,
          title: '每时每课'
      }
  },
  {
    path: '/aa',
    name: 'aa',
    component: () =>
        import('@/views/index/aa.vue'),
    meta: {
        footer: true,
        title: '课程详情'
    }
  },
  {
    path: '/member',
    name: 'member',
    component: () =>
        import('@/views/index/member.vue'),
    meta: {
        footer: true,
        title: '课程详情'
    }
  },
  {
    path: '/star',
    name: 'star',
    component: () =>
        import('@/views/index/star.vue'),
    meta: {
        footer: true,
        title: '课程详情'
    }
  },
  {
    path: '/course',
    name: 'course',
    component: () =>
        import('@/views/course/course.vue'),
    meta: {
        footer: true,
        title: '特色课'
    }
  },
  {
    path: '/Search',
    name: 'Search',
    component: () =>
        import('@/views/course/Search.vue'),
    meta: {
        footer: true,
        title: '特色课--搜索'
    }
  },
  {
    path: '/coursedata',
    name: 'coursedata',
    component: () =>
        import('@/views/course/compon/coursedata.vue'),
    meta: {
        footer: true,
        title: '课程详情'
    }
  },
  {
    path: '/record',
    name: 'record',
    component: () =>
        import('@/views/record/record.vue'),
    meta: {
        footer: true,
        title: '约课记录'
    }
  },
  {
    path: '/practise',
    name: 'Practise',
    component: () =>
        import('@/views/practise/practise.vue'),
    meta: {
        footer: true,
        title: '练习',

    }
  },
  {
    path: '/my',
    name: 'my',
    component: my,
    meta:{
      requtreAuth:true,
      title:"我的"
    }
  },
  {
    path: '/login',
    name: 'login',
    component: () =>
        import('@/views/login/login.vue'),
    meta:{
      footer: true,
      title:"登录"
    }
  },
  {
    path: '/smslogin',
    name: 'smslogin',
    component: () =>
        import('@/views/login/sms-login.vue'),
    meta:{
      footer: true,
      title:"注册"
    }
  },
  {
    path: '/setpass',
    name: 'setpass',
    component: () =>
        import('@/views/login/setpass.vue'),
    meta:{
      footer: true,
      title:"密码设置"
    }
  },
  {
    path: '/setmessage',
    name: 'setmessage',
    component: () =>
        import('@/views/login/setmessage.vue'),
    meta:{
      footer: true,
      title:"信息填写"
    }
  },
  
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home,
  //   meta:{
  //     requtreAuth:true,
  //     title:"首页"
  //   },
  //   children:[
      
  //   ],
  //   redirect:"/index"
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
